import request from '@/utils/request'

export function fetchMasterdataTableList(data) {
  return request({
    url: '/system/masterdata/MasterdataTable/list',
    method: 'post',
    data
  })
}
//获取数据源
export function getSourceList() {
  return request({
    url: '/system/metadata/source/getSourceList',
    method: 'get'
  })
}
//获取表列表
export function getTableList(data) {
  return request({
    url: '/system/metadata/table/tableList',
    method: 'post',
    data
  })
}
export function getMasterdataTable(id) {
  return request({
    url: '/system/masterdata/MasterdataTable/detail/' + id,
    method: 'get'
  })
}

export function createMasterdataTable(data) {
  return request({
    url: '/system/masterdata/MasterdataTable/add',
    method: 'post',
    data
  })
}

export function updateMasterdataTable(data) {
  return request({
    url: '/system/masterdata/MasterdataTable/update',
    method: 'post',
    data
  })
}

export function deleteMasterdataTable(ids) {
  return request({
    url: '/system/masterdata/MasterdataTable/delete',
    method: 'post',
    data: { ids }
  })
}

export function exportMasterdataTable(data) {
  return request({
    url: '/system/masterdata/MasterdataTable/export',
    method: 'post',
    data
  })
}
